<template>
  <div class="home">
    <header class="home-header">
      <img src="/assets/piggy-mascot.svg" alt="存钱罐精灵" class="mascot" />
      <h1>小财神记账乐园</h1>
    </header>
    <section class="accounts">
      <div class="account jar">
        <div class="label">零钱罐</div>
        <div class="amount">￥{{ pocketMoney.toFixed(2) }}</div>
      </div>
      <div class="account box">
        <div class="label">存钱箱</div>
        <div class="amount">￥{{ savingsBox.toFixed(2) }}</div>
        <div class="interest-guide">💡 初始状态带引导动画</div>
      </div>
    </section>
    <router-link to="/record" class="record-btn">记一笔</router-link>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

// 零钱罐金额 (示例数据)
const pocketMoney = ref(12.50);
// 存钱箱金额 (示例数据)
const savingsBox = ref(150.00);

// 后续可从状态管理或API获取真实数据
</script>

<style scoped>
.home {
  background: #F9F9F9;
  min-height: 100vh;
  padding: 0 0 40px 0;
}
.home-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 8px 16px;
}
.mascot {
  width: 48px;
  height: 48px;
  margin-right: 12px;
}
.accounts {
  display: flex;
  justify-content: space-around;
  margin: 32px 0 24px 0;
}
.account {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px #eee;
  padding: 16px 24px;
  min-width: 120px;
  text-align: center;
}
.label {
  font-size: 16px;
  color: #888;
}
.amount {
  font-size: 28px;
  color: #222;
  margin: 8px 0;
}
.interest-guide {
  font-size: 12px;
  color: #6CC417;
  margin-top: 4px;
}
.record-btn {
  display: block;
  margin: 0 auto;
  width: 80vw;
  max-width: 320px;
  background: #6CC417;
  color: #fff;
  text-align: center;
  border-radius: 32px;
  padding: 16px 0;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 8px #cdebb0;
  transition: background 0.2s;
}
.record-btn:active {
  background: #4e9e13;
}
</style>